Check for zero values before rounding.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 22 Apr 2006 18:36:57 +0000 (18:36 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 22 Apr 2006 18:36:57 +0000 (18:36 +0000)
gpsbabel/holux.c

index f3f44876ace8afeb8dfd99c29d87f1de14eafd2a..c63a02bd19ee700c26f20e017920fd3ce769b659 100644 (file)
@@ -188,9 +188,8 @@ static void holux_disp(const waypoint *wpt)
 
 
     /* round it to increase the accuracy */
-    lon += (double)((int)lon/abs((int)lon)) * .5;
-    lat += (double)((int)lat/abs((int)lat)) * .5;
-
+    if (lon != 0) lon += (double)((int)lon/abs((int)lon)) * .5;
+    if (lat != 0) lat += (double)((int)lat/abs((int)lat)) * .5;
 
     sIndex =  le_read16(&((WPTHDR *)HxWFile)->num);
     ((WPTHDR *)HxWFile)->idx[sIndex] = sIndex;         /* set the waypoint index  */